<template>
  <div id="app">
    <router-view v-if="isRouterAlive" />
    <section class="loading" v-if="loading">
      <div
        v-loading="true"
        element-loading-background="rgba(0, 0, 0, 0.8)"
      ></div>
      <p>加载中...</p>
    </section>
  </div>
</template>

<script>
import { work_type } from "@/utils/codeList";
export default {
  name: "App",
  provide() {
    return {
      reload: this.reload
    };
  },
  data() {
    return {
      isRouterAlive: true
    };
  },
  created() {
    console.log("程序员刘天帝调试专用");
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function() {
        this.isRouterAlive = true;
      });
    }
  },
  computed: {
    loading() {
      return this.$store.getters.loading;
    },
    loginShow() {
      return this.$store.getters.loginShow;
    }
  }
};
</script>

<style>
#app {
  min-width: 1600px;
}
.backtop {
  position: fixed;
  z-index: 55;
  right: 50px;
  bottom: 50px;
}

img {
  object-fit: cover;
  display: block;
}
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading p {
  color: #409eff;
  margin-top: 100px;
  font-size: 18px;
  letter-spacing: 2px;
}

.header .router-link-exact-active {
  color: #2469b9 !important;
  position: relative;
}
.header .router-link-exact-active::after {
  content: "";
  width: 126px;
  height: 3px;
  background: #2469b9;
  position: absolute;
  bottom: -20px;
  left: 8%;

}
</style>
